/**
 * @mbggenerated
 * @author wujian
 */
package bearworker.zxl.dao.mapper;

import bearworker.zxl.entity.DeliveryWxpayRecords;
import org.apache.ibatis.jdbc.SQL;

public class DeliveryWxpayRecordsSqlProvider {

    /* @mbggenerated */
    public String insertSelective(DeliveryWxpayRecords record) {
        return new SQL() {{
            INSERT_INTO("delivery_wxpay_records");

            if (record.getAppid() != null) {
                VALUES("appid", "#{appid,jdbcType=VARCHAR}");
            }

            if (record.getMchId() != null) {
                VALUES("mch_id", "#{mchId,jdbcType=VARCHAR}");
            }

            if (record.getNonceStr() != null) {
                VALUES("nonce_str", "#{nonceStr,jdbcType=VARCHAR}");
            }

            if (record.getSign() != null) {
                VALUES("sign", "#{sign,jdbcType=VARCHAR}");
            }

            if (record.getBody() != null) {
                VALUES("body", "#{body,jdbcType=VARCHAR}");
            }

            if (record.getOutTradeNo() != null) {
                VALUES("out_trade_no", "#{outTradeNo,jdbcType=VARCHAR}");
            }

            if (record.getTotalFee() != null) {
                VALUES("total_fee", "#{totalFee,jdbcType=INTEGER}");
            }

            if (record.getSpbillCreateIp() != null) {
                VALUES("spbill_create_ip", "#{spbillCreateIp,jdbcType=VARCHAR}");
            }

            if (record.getNotifyUrl() != null) {
                VALUES("notify_url", "#{notifyUrl,jdbcType=VARCHAR}");
            }

            if (record.getTradeType() != null) {
                VALUES("trade_type", "#{tradeType,jdbcType=VARCHAR}");
            }

            if (record.getOpenid() != null) {
                VALUES("openid", "#{openid,jdbcType=VARCHAR}");
            }

            if (record.getResReturnCode() != null) {
                VALUES("res_return_code", "#{resReturnCode,jdbcType=VARCHAR}");
            }

            if (record.getResReturnMsg() != null) {
                VALUES("res_return_msg", "#{resReturnMsg,jdbcType=VARCHAR}");
            }

            if (record.getResAppid() != null) {
                VALUES("res_appid", "#{resAppid,jdbcType=VARCHAR}");
            }

            if (record.getResMchId() != null) {
                VALUES("res_mch_id", "#{resMchId,jdbcType=VARCHAR}");
            }

            if (record.getResNonceStr() != null) {
                VALUES("res_nonce_str", "#{resNonceStr,jdbcType=VARCHAR}");
            }

            if (record.getResSign() != null) {
                VALUES("res_sign", "#{resSign,jdbcType=VARCHAR}");
            }

            if (record.getResResultCode() != null) {
                VALUES("res_result_code", "#{resResultCode,jdbcType=VARCHAR}");
            }

            if (record.getResPrepayId() != null) {
                VALUES("res_prepay_id", "#{resPrepayId,jdbcType=VARCHAR}");
            }

            if (record.getResTradeType() != null) {
                VALUES("res_trade_type", "#{resTradeType,jdbcType=VARCHAR}");
            }

            if (record.getCreateTime() != null) {
                VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
            }

            if (record.getJsTimestamp() != null) {
                VALUES("js_timeStamp", "#{jsTimestamp,jdbcType=VARCHAR}");
            }

            if (record.getJsPackage() != null) {
                VALUES("js_package", "#{jsPackage,jdbcType=VARCHAR}");
            }

            if (record.getJsSigntype() != null) {
                VALUES("js_signType", "#{jsSigntype,jdbcType=VARCHAR}");
            }

            if (record.getJsSign() != null) {
                VALUES("js_sign", "#{jsSign,jdbcType=VARCHAR}");
            }

        }}.toString();
    }

    /* @mbggenerated */
    public String updateByPrimaryKeySelective(DeliveryWxpayRecords record) {
        return new SQL() {
            {
                UPDATE("delivery_wxpay_records");

                if (record.getAppid() != null) {
                    SET("appid = #{appid,jdbcType=VARCHAR}");
                }

                if (record.getMchId() != null) {
                    SET("mch_id = #{mchId,jdbcType=VARCHAR}");
                }

                if (record.getNonceStr() != null) {
                    SET("nonce_str = #{nonceStr,jdbcType=VARCHAR}");
                }

                if (record.getSign() != null) {
                    SET("sign = #{sign,jdbcType=VARCHAR}");
                }

                if (record.getBody() != null) {
                    SET("body = #{body,jdbcType=VARCHAR}");
                }

                if (record.getOutTradeNo() != null) {
                    SET("out_trade_no = #{outTradeNo,jdbcType=VARCHAR}");
                }

                if (record.getTotalFee() != null) {
                    SET("total_fee = #{totalFee,jdbcType=INTEGER}");
                }

                if (record.getSpbillCreateIp() != null) {
                    SET("spbill_create_ip = #{spbillCreateIp,jdbcType=VARCHAR}");
                }

                if (record.getNotifyUrl() != null) {
                    SET("notify_url = #{notifyUrl,jdbcType=VARCHAR}");
                }

                if (record.getTradeType() != null) {
                    SET("trade_type = #{tradeType,jdbcType=VARCHAR}");
                }

                if (record.getOpenid() != null) {
                    SET("openid = #{openid,jdbcType=VARCHAR}");
                }

                if (record.getResReturnCode() != null) {
                    SET("res_return_code = #{resReturnCode,jdbcType=VARCHAR}");
                }

                if (record.getResReturnMsg() != null) {
                    SET("res_return_msg = #{resReturnMsg,jdbcType=VARCHAR}");
                }

                if (record.getResAppid() != null) {
                    SET("res_appid = #{resAppid,jdbcType=VARCHAR}");
                }

                if (record.getResMchId() != null) {
                    SET("res_mch_id = #{resMchId,jdbcType=VARCHAR}");
                }

                if (record.getResNonceStr() != null) {
                    SET("res_nonce_str = #{resNonceStr,jdbcType=VARCHAR}");
                }

                if (record.getResSign() != null) {
                    SET("res_sign = #{resSign,jdbcType=VARCHAR}");
                }

                if (record.getResResultCode() != null) {
                    SET("res_result_code = #{resResultCode,jdbcType=VARCHAR}");
                }

                if (record.getResPrepayId() != null) {
                    SET("res_prepay_id = #{resPrepayId,jdbcType=VARCHAR}");
                }

                if (record.getResTradeType() != null) {
                    SET("res_trade_type = #{resTradeType,jdbcType=VARCHAR}");
                }

                if (record.getCreateTime() != null) {
                    SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
                }

                if (record.getJsTimestamp() != null) {
                    SET("js_timeStamp = #{jsTimestamp,jdbcType=VARCHAR}");
                }

                if (record.getJsPackage() != null) {
                    SET("js_package = #{jsPackage,jdbcType=VARCHAR}");
                }

                if (record.getJsSigntype() != null) {
                    SET("js_signType = #{jsSigntype,jdbcType=VARCHAR}");
                }

                if (record.getJsSign() != null) {
                    SET("js_sign = #{jsSign,jdbcType=VARCHAR}");
                }

                WHERE("id = #{id,jdbcType=INTEGER}");

            }
        }.toString();
    }
}